function bx_app_pass_toggle(s){if(BX.hasClass(s,"open")){BX.removeClass(s,"open");BX.addClass(s,"close")}else{BX.removeClass(s,"close");BX.addClass(s,"open")}return false}function bx_app_pass_show_create_window(s){s=BX(s);var a={SYSCOMMENT:s.SYSCOMMENT?s.SYSCOMMENT.value:"",COMMENT:s.COMMENT.value,APPLICATION_ID:s.APPLICATION_ID.value,action:"add",sessid:BX.message("bitrix_sessid")};var e={method:"POST",dataType:"json",url:"/bitrix/components/bitrix/main.app.passwords/ajax.php",data:a,onsuccess:function(s){BX.removeClass(BX("bx_app_pass_close_button"),"wait");if(s.success===true){var e=BX("bx_app_pass_lottery");BX.removeClass(e,"bx-otp-popup-lottery-black");BX.addClass(e,"bx-otp-popup-lottery-white");BX("bx_app_pass_password").innerHTML=s.password;var t=[{className:"bx-otp-access-table-param",content:BX.util.htmlspecialchars(a.SYSCOMMENT)+"\n"+"<small>"+BX.util.htmlspecialchars(a.COMMENT)+"</small>"},{className:"bx-otp-access-table-value",content:s.date_create},{className:"bx-otp-access-table-value",content:""},{className:"bx-otp-access-table-value",content:""},{className:"bx-otp-access-table-action",content:'<a class="bx-otp-btn big lightgray mb0" href="javascript:void(0);" onclick="bx_app_pass_show_delete_window('+s.id+')">'+bx_app_pass_mess.deleteButton+"</a>"}];var p=BX("bx_app_pass_table_"+a.APPLICATION_ID);var o=p.insertRow(p.rows.length-1);o.id="bx_app_pass_row_"+s.id;for(var l in t){var _=o.insertCell(-1);_.className=t[l].className;_.innerHTML=t[l].content}}else{alert(s.message)}}};var t=BX.PopupWindowManager.create("bx_app_pass_create",null,{autoHide:false,offsetLeft:0,offsetTop:0,overlay:true,closeByEsc:true,closeIcon:{right:"12px",top:"10px"},content:BX("bx_app_pass_new_password")});BX("bx_app_pass_password").innerHTML="";var p=BX("bx_app_pass_lottery");BX.removeClass(p,"bx-otp-popup-lottery-white");BX.addClass(p,"bx-otp-popup-lottery-black");BX.addClass(BX("bx_app_pass_close_button"),"wait");t.show();BX.ajax(e)}function bx_app_pass_show_delete_window(s){var a={ID:s,action:"delete",sessid:BX.message("bitrix_sessid")};var e={method:"POST",dataType:"json",url:"/bitrix/components/bitrix/main.app.passwords/ajax.php",data:a,onsuccess:function(a){BX.removeClass(BX("bx_app_pass_del_button"),"wait");if(a.success===true){BX("bx_app_pass_row_"+s).style.display="none";t.close()}else{alert(a.message)}}};BX.removeClass(BX("bx_app_pass_del_button"),"wait");var t=BX.PopupWindowManager.create("bx_app_pass_delete",null,{autoHide:false,offsetLeft:0,offsetTop:0,overlay:true,closeByEsc:true,closeIcon:{right:"12px",top:"10px"},content:BX("bx_app_pass_delete_password")});BX("bx_app_pass_del_button").onclick=function(){BX.addClass(BX("bx_app_pass_del_button"),"wait");BX.ajax(e)};t.show()}
//# sourceMappingURL=script.map.js